package com.ludomancy.hugealien;



import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import com.ludomancy.gamelib.Theme;
import com.ludomancy.gamelib.Utils;

public class GameTheme extends Theme
{
	public static GameTheme theme;
	public Font ingame; 
	public Font bigFont;
	public Font title;
	
	public GameTheme()
	{
		theme = this;
		
		try
		{
			Font standard = Utils.loadFont("/computer.ttf");
			defaultFont = standard.deriveFont(Font.PLAIN, 27);
			ingame = standard.deriveFont(Font.PLAIN, 12);
			bigFont = standard.deriveFont(Font.PLAIN, 40);
			title = standard.deriveFont(Font.PLAIN, 25);
		} 
		catch (Exception e)
		{
		}
	}
		
	public void fillUIBackground(Graphics g, Rectangle area)
	{
		g.setColor(getUIBackgroundColor());
		g.fillRoundRect(area.x, area.y, area.width, area.height, 10, 10);
		g.setColor(getDefaultBorderColor());
		g.drawRoundRect(area.x, area.y, area.width-1, area.height-1, 10, 10);
	}
	
	public Color getDefaultTextColor()
	{
		return new Color(0xE4E2E2);
	}
	
	public Color getDefaultBorderColor()
	{
		return new Color(0x5E5E5E);
	}
	
	public Color getUIBackgroundColor()
	{
		return new Color(0x454545);
	}
	
	public void drawShadowText(Graphics g, String text, int width, int x, int y)
	{
		g.setColor(new Color(0x333333));
		g.setFont(ingame);
		Utils.drawMultiline(g, text, width, x, y);
		g.setColor(new Color(0xC4C2C2));
		Utils.drawMultiline(g, text, width, x, y);
	}
	
	public void fillButton(Graphics g, Rectangle area, boolean etched)
	{
		Graphics2D g2 = (Graphics2D) g;
		g2.setColor(new Color(0x656565));
		g2.fill3DRect(0, 0, area.width-1, area.height-1, !etched);
	}
}
